package org.chen.result;

import lombok.Data;
import org.chen.common.UserWithChat;

import java.io.Serializable;

@Data
public class FindPasswordResponse implements Serializable {
    // 状态码
    private Integer code;

    private Boolean success;

    private UserWithChat userWithChat = new UserWithChat();

    // 错误响应
    public static FindPasswordResponse error(Integer code) {
        FindPasswordResponse response = new FindPasswordResponse();
        response.setSuccess(false);
        response.setCode(code);
        return response;
    }

    public static FindPasswordResponse success(UserWithChat userWithChat) {
        FindPasswordResponse response = new FindPasswordResponse();
        response.setSuccess(true);
        response.setUserWithChat(userWithChat);
        return response;
    }
}
